#ifndef SDK_OHOS_API_OHOS_PEER_CONNECTION_FACTORY_INTERFACE_H_
#define SDK_OHOS_API_OHOS_PEER_CONNECTION_FACTORY_INTERFACE_H_

#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "rtc_base/thread.h"
#include "api/peer_connection_interface.h"
#include "api/media_types.h"
#include "api/rtp_parameters.h"
#include "ohos_audio_source_interface.h"
#include "ohos_audio_track_interface.h"
#include "ohos_video_track_interface.h"
#include "ohos_video_source_interface.h"
#include "ohos_media_stream_interface.h"
#include "ohos_peer_connection_interface.h"
#include "ohos_media_constraints_interface.h"

namespace ohoswebrtc {

class OHOSPeerConnectionFactoryInterface : public webrtc::RefCountInterface {
 public:
  
  /** Initialize an RTCPeerConnection with a configuration, constraints. */
  virtual rtc::scoped_refptr<OHOSPeerConnectionInterface> CreatePeerConnection(
      webrtc::PeerConnectionInterface::RTCConfiguration& configuration,
      rtc::scoped_refptr<OHOSMediaConstraintsInterface> constraints,
      OHOSPeerConnectionObserver *observer) = 0;
  
  /** Returns the capabilities of an RTP sender of type `kind`. */
  virtual webrtc::RtpCapabilities GetRtpSenderCapabilities(
      cricket::MediaType kind) const = 0;
  
  /** Returns the capabilities of an RTP receiver of type `kind`. */
  virtual webrtc::RtpCapabilities GetRtpReceiverCapabilities(
      cricket::MediaType kind) const = 0;
  
  /** Initialize an OHOSAudioSource with constraints. */
  virtual rtc::scoped_refptr<OHOSAudioSourceInterface> CreateAudioSource(
      rtc::scoped_refptr<OHOSMediaConstraintsInterface> constraints) = 0;
  
  /** Initialize an OHOSAudioTrack with an id. Convenience ctor to use an audio source
   * with no constraints.
   */
  virtual rtc::scoped_refptr<OHOSAudioTrackInterface> CreateAudioTrack(
      rtc::scoped_refptr<OHOSAudioSourceInterface> source, const std::string track_id) = 0;

  /** Initialize a generic OHOSVideoSource with he posibility of marking
   * it as usable for screen sharing. The OHOSVideoSource should be
   * passed to a CameraVideoCapturer, in order to produce frames.
   */
  virtual rtc::scoped_refptr<OHOSVideoSourceInterface> CreateVideoSource(const bool is_screen) = 0;
  
  /** Initialize an OHOSVideoTrack with a source and an id. */
  virtual rtc::scoped_refptr<OHOSVideoTrackInterface> CreateVideoTrack(
      rtc::scoped_refptr<OHOSVideoSourceInterface> source, const std::string track_id) = 0;
  
  /** Initialize an OHOSMediaStream with an id. */
  virtual rtc::scoped_refptr<OHOSMediaStreamInterface> CreateLocalMediaStream(
      const std::string stream_id) = 0;
      
  /**
   * PeerConnectionFactoryInterface representation of this OHOSPeerConnectionFactory
   */
  virtual rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory() = 0;

  virtual rtc::Thread* network_thread() = 0;

  virtual rtc::Thread* signaling_thread() = 0;

  virtual rtc::Thread* worker_thread() = 0;
};

}

#endif